var Adv_skd=require("./Adv_skd3")

cc.Class({
  extends: cc.Component,
  properties: {
    timeLabel: cc.Label
  },
  initBy: function (e) {
        Adv_skd.default.instance.hideAllAdv();
    
     Adv_skd.default.instance.showInterstitialAd();
        Adv_skd.default.instance.showGridAdTop();
        Adv_skd.default.instance.showBannerAd();
    this.ui = e;
  },
  onClickClose: function () {
        Adv_skd.default.instance.hideAllAdv();
    
    cc.popupManager.removePopup(this);
  },
  onClickAd: function () {
    Adv_skd.default.instance.hideAllAdv();

    var e = this;
    cc.pvz.AdUtils.showAdRewardVideo(cc.pvz.GameConfig.AdType.无尽火力, function (t) {
      if (t) {
        e.ui.enterGame2();
        cc.popupManager.removePopup(e);
      }
    });
  },
  update: function () {
    var e = (cc.player.game2t || -1) + 18e5 - Date.now();
    this.timeLabel.string = cc.pvz.utils.formatSeconds2(Math.floor(e / 1e3));
  }
});